package com.tangkeyon.service;

import com.tangkeyon.common.ResponseCode;
import com.tangkeyon.pojo.User;

/**
 * @Author: tangkeyon@gmail.com
 * @Date: 2019/5/21 9:15
 * @Version 1.0
 */
public interface IUserService {

    /**
     * 登录
     * @param username
     * @param password
     * @return
     */
    ResponseCode<User> login(String username,String password);

    /**
     * 注册
     * @param user
     * @return
     */
    ResponseCode<String> registerUser(User user);

    /**
     * 对参数进行实时检验
     * @param value
     * @param type
     * @return
     */
    ResponseCode<String> checkValid(String value,String type);


    /**
     * 根据用户名获得对应的密保问题
     * @param username
     * @return
     */
     ResponseCode<String> getForgetQuestion(String username);

    /**
     * 检验密保问题的回答情况，并返回Token
     * @param username
     * @param question
     * @param answer
     * @return
     */
    ResponseCode<String> checkQuestionAnswer(String username,String question,String answer);

    /**
     * 重置密码
     * @param username
     * @param password
     * @param token
     * @return
     */
    ResponseCode<String> resizePassword(String username,String password,String token);

    ResponseCode<String> changePasswordLoginState(String passwordNew, String passwordOld , Integer id);

    ResponseCode<User> selectUserInfoById(Integer id);

    ResponseCode<String> updateUserInformation(User user);

}
